3.1.9 \(\int \cos ^2(c+d x) (A+C \sec ^2(c+d x)) \, dx\) [9]

Optimal. Leaf size=31 \[ \frac {1}{2} (A+2 C) x+\frac {A \cos (c+d x) \sin (c+d x)}{2 d} \]

[Out]

1/2*(A+2*C)*x+1/2*A*cos(d*x+c)*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4130, 8} \begin {gather*} \frac {A \sin (c+d x) \cos (c+d x)}{2 d}+\frac {1}{2} x (A+2 C) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2*(A + C*Sec[c + d*x]^2),x]

[Out]

((A + 2*C)*x)/2 + (A*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 4130

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[A*Cot[e
+ f*x]*((b*Csc[e + f*x])^m/(f*m)), x] + Dist[(C*m + A*(m + 1))/(b^2*m), Int[(b*Csc[e + f*x])^(m + 2), x], x] /
; FreeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]

Rubi steps

\begin {align*} \int \cos ^2(c+d x) \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos (c+d x) \sin (c+d x)}{2 d}+\frac {1}{2} (A+2 C) \int 1 \, dx\\ &=\frac {1}{2} (A+2 C) x+\frac {A \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 33, normalized size = 1.06 \begin {gather*} C x+\frac {A (c+d x)}{2 d}+\frac {A \sin (2 (c+d x))}{4 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2*(A + C*Sec[c + d*x]^2),x]

[Out]

C*x + (A*(c + d*x))/(2*d) + (A*Sin[2*(c + d*x)])/(4*d)

________________________________________________________________________________________

Maple [A]
time = 0.28, size = 37, normalized size = 1.19

method result size
risch \(\frac {A x}{2}+C x +\frac {A \sin \left (2 d x +2 c \right )}{4 d}\) \(24\)
derivativedivides \(\frac {A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \left (d x +c \right )}{d}\) \(37\)
default \(\frac {A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C \left (d x +c \right )}{d}\) \(37\)
norman \(\frac {\left (-\frac {A}{2}-C \right ) x +\left (-\frac {A}{2}-C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {A}{2}+C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {A}{2}+C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 A \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}\) \(147\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*(A+C*sec(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(A*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)+C*(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 37, normalized size = 1.19 \begin {gather*} \frac {{\left (d x + c\right )} {\left (A + 2 \, C\right )} + \frac {A \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(A+C*sec(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*((d*x + c)*(A + 2*C) + A*tan(d*x + c)/(tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

Fricas [A]
time = 2.23, size = 28, normalized size = 0.90 \begin {gather*} \frac {{\left (A + 2 \, C\right )} d x + A \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(A+C*sec(d*x+c)^2),x, algorithm="fricas")

[Out]

1/2*((A + 2*C)*d*x + A*cos(d*x + c)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [A]
time = 3.64, size = 51, normalized size = 1.65 \begin {gather*} A \left (\begin {cases} \frac {x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {\sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \cos ^{2}{\left (c \right )} & \text {otherwise} \end {cases}\right ) + C x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*(A+C*sec(d*x+c)**2),x)

[Out]

A*Piecewise((x*sin(c + d*x)**2/2 + x*cos(c + d*x)**2/2 + sin(c + d*x)*cos(c + d*x)/(2*d), Ne(d, 0)), (x*cos(c)
**2, True)) + C*x

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 37, normalized size = 1.19 \begin {gather*} \frac {{\left (d x + c\right )} {\left (A + 2 \, C\right )} + \frac {A \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(A+C*sec(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*((d*x + c)*(A + 2*C) + A*tan(d*x + c)/(tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

Mupad [B]
time = 2.36, size = 25, normalized size = 0.81 \begin {gather*} \frac {\frac {A\,\sin \left (2\,c+2\,d\,x\right )}{4}+d\,x\,\left (\frac {A}{2}+C\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2*(A + C/cos(c + d*x)^2),x)

[Out]

((A*sin(2*c + 2*d*x))/4 + d*x*(A/2 + C))/d

________________________________________________________________________________________